<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
    <title>TODO supply a title</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="favicon.ico"> <link href="__PUBLIC__/newWeb/css/bootstrap.min.css" rel="stylesheet">
    <link href="__PUBLIC__/newWeb/css/font-awesome.css" rel="stylesheet">

    <!-- Data Tables -->
    <link href="__PUBLIC__/newWeb/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">

    <link href="__PUBLIC__/newWeb/css/animate.css" rel="stylesheet">
    <link href="__PUBLIC__/newWeb/css/style.css" rel="stylesheet">
    <style type="text/css">
        .form-control,
        .single-line{
            padding-top: 4px ; !important;
        }
    </style>
</head>
<body class="gray-bg">
<div class="row">
    <div class="col-sm-12">
        <div class="ibox float-e-margins animated fadeInRight">
            <div class="ibox-title">
                <h5>二维码管理</h5>
                <div class="ibox-tools">
                    <a href="{:U('QrCode/qrAdd')}">
                        <button class="btn btn-info" type="button" style="margin-top: -8px"><i class="fa fa-paste"></i>新增</button>
                    </a>
                </div>
            </div>
            <div class="ibox-content">
                <table class="table table-striped table-bordered table-hover dataTables-example">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>名称</th>
                        <th>url</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <foreach name="qrList" item="vo" key="k" >
                        <tr class="gradeX">
                            <td>{$vo.id}</td>
                            <td>{$vo.name}</td>
                            <td>{$vo.url}</td>
                            <td class="center">
                                <a onclick="layer('{$vo.name}','{$vo.url}');">
                                    <button class="btn btn-info btnEdit" type="button"><i class="fa fa-paste"></i> 查看</button>
                                </a>
                                <a href="{:U('QrCode/qrEdit',['id'=>$vo['id']])}">
                                    <button class="btn btn-info btnEdit" type="button"><i class="fa fa-paste"></i> 编辑</button>
                                </a>
                                <a href="{:U('QrCode/qrDelete',['id'=>$vo['id']])}">
                                    <button class="btn btn-danger btnDel" type="button"><i class="fa fa-paste"></i> 删除</button>
                                </a>
                            </td>
                        </tr>
                    </foreach>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<!-- 全局js -->
<script src="__PUBLIC__/newWeb/js/jquery.min.js"></script>
<script src="__PUBLIC__/newWeb/js/bootstrap.min.js"></script>



<script src="__PUBLIC__/newWeb/js/plugins/jeditable/jquery.jeditable.js"></script>

<!-- Data Tables -->
<script src="__PUBLIC__/newWeb/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="__PUBLIC__/newWeb/js/plugins/dataTables/dataTables.bootstrap.js"></script>

<!-- 自定义js -->
<script src="__PUBLIC__/newWeb/js/content.js"></script>


<!-- Page-Level Scripts -->
<script>
    $(document).ready(function () {
        $('.dataTables-example').dataTable();
        /* Init DataTables */
    });
    function layer(name,url) {
        var $request = "{:U('QrCode/qrCode')}";
        $request += "?url=" + url;
        //页面层
        parent.layer.open({
            title:name,
            type: 1,
            skin: 'layui-layer-rim', //加上边框
            area: ['490px', '530px'], //宽高
            content: '<img style="width:470px;height: 470px;" src="'+$request+'">'
        });
    }
</script>
</body>

</html>
